//
// Created by Wirano on 2020/11/10.
//

#ifndef ANO_PORT_ANO_OPMV_LINETRACKING_CTRL_H
#define ANO_PORT_ANO_OPMV_LINETRACKING_CTRL_H

//==引用
//#include "sysconfig.h"
#include "Ano_FcData.h"

//==定义
typedef struct {
    //
    uint8_t target_loss;
    //
    int16_t opmv_pos;
    int16_t r2pixel_val;

    //
    float decou_pos_pixel;
    float ground_pos_err_h_cm;
    float ground_pos_err_d_h_cmps;


    //
    float exp_velocity_h_cmps[2];
    float exp_yaw_pal_dps;
} _ano_opmv_lt_ctrl_st;

//==数据声明
extern _ano_opmv_lt_ctrl_st ano_opmv_lt_ctrl;

//==函数声明

//static
static void ANO_LTracking_Decoupling(uint8_t *dT_ms, float rol_degs, float pit_degs);

static void ANO_LTracking_Calcu(uint8_t *dT_ms, int32_t relative_height_cm);

//public
void ANO_LTracking_Task(uint8_t dT_ms);

void ANO_LTracking_Ctrl(uint8_t *dT_ms, uint8_t en);

#endif //ANO_PORT_ANO_OPMV_LINETRACKING_CTRL_H
